<?php
	require_once 'CloudKey.php';
	//http://www.dmcloud.net/doc/api/streaming.html#streaming
	//http://www.dmcloud.net/doc/api/php-sdk.html#php-sdk
	//liste des formats à utiliser.
	$hdFile ="mp4_h264_aac_hd";
	$lowFile = "mp4_h264_aac";
	$jpegFile = "jpeg_thumbnail_source";
	
	function getId()
	{
		//id utilisateur
		return "4fc87b3d06361d1b4d0000b4";
	}
	
	function getApiKey()
	{
		//Clé de l'API
		return "3267c2b2ef01a098d868ff90a4301168e6728f4e";
	}
	
	
	function getUrl($id,$name)
	{
		$cloudkey = new CloudKey(getId(), getApiKey());
		$url = $cloudkey->media->get_stream_url(
			array(
			'id' => $id,
			'asset_name' => $name,
			'seclevel' => CLOUDKEY_SECLEVEL_DELEGATE | CLOUDKEY_SECLEVEL_ASNUM,
			'expires' => time() + 90000
			)
		);
		return $url;
	}
?>